Skip to content

Fix song select buttons not working after attempting to force-exit when mod select is open - #38221

Open
Joehuu wants to merge 3 commits into
ppy:masterfrom
Joehuu:fix-hidden-buttons-removal
Open

Fix song select buttons not working after attempting to force-exit when mod select is open#38221
Joehuu wants to merge 3 commits into
ppy:masterfrom
Joehuu:fix-hidden-buttons-removal

Conversation

@Joehuu

@Joehuu Joehuu commented Jul 4, 2026

Copy link
Copy Markdown
Member

When pressing Alt-F4, the mod select overlay never closes and does this in order:

SetButton();
clearActiveOverlayContainer(); // inside SetButton()

Pressing home or exiting via Esc runs clearActiveOverlayContainer() first, and it doesn't trigger the bug because the hiddenButtonsContainer container gets cleared before the temporarilyHiddenButtons list does. Unsure why SetButtons() needs to clear temporarilyHiddenButtons. There's no regression when I tested.

Hide()ing the overlay on the screen's OnExiting() is also a fix. MultiplayerMatchSongSelect already has freeModSelect.Hide().

I've applied both above as one makes sure the bug doesn't happen anymore when forgetting to Hide() the overlay on the screen's OnExiting() and the other fixes the no pop out animation.


public void SetButtons(IReadOnlyList<ScreenFooterButton> buttons)
{
temporarilyHiddenButtons.Clear();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Subjective, but this change looks incorrect to me and it also behaves incorrectly in my opinion.

When SetButtons() is called with some buttons temporarily hidden this change makes it so that those temporarily hidden buttons are unhidden without transitions and then transitioned out.

master:

Screen.Recording.2026-07-07.at.07.31.27.mov

this PR:

Screen.Recording.2026-07-07.at.07.30.36.mov

test:

diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneScreenFooter.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneScreenFooter.cs
index cc74bcd598..1b04e39519 100644
--- a/osu.Game.Tests/Visual/UserInterface/TestSceneScreenFooter.cs
+++ b/osu.Game.Tests/Visual/UserInterface/TestSceneScreenFooter.cs
@@ -144,6 +144,45 @@ public void TestExternalOverlayContent()
             AddAssert("other buttons returned", () => ScreenFooter.ChildrenOfType<ScreenFooterButton>().Skip(1).All(b => b.ChildrenOfType<Container>().First().Y == 0));
         }
 
+        [Test]
+        public void TestBreakings()
+        {
+            TestScreen screen = null!;
+
+            AddStep("push screen", () =>
+            {
+                ShearedOverlayContainer overlay = new TestShearedOverlayContainer();
+
+                LoadScreen(screen = new TestScreen
+                {
+                    Overlay = overlay,
+                    CreateButtons = () => new[]
+                    {
+                        new ScreenFooterButton(overlay)
+                        {
+                            AccentColour = Dependencies.Get<OsuColour>().Orange1,
+                            Icon = FontAwesome.Solid.Toolbox,
+                            Text = "One",
+                        },
+                        new ScreenFooterButton { Text = "Two", Action = () => { } },
+                        new ScreenFooterButton { Text = "Three", Action = () => { } },
+                    },
+                });
+            });
+            AddUntilStep("wait until screen is loaded", () => screen.IsCurrentScreen(), () => Is.True);
+
+            AddStep("show overlay", () => screen.Overlay.Show());
+
+            AddStep("asd", () => ScreenFooter.SetButtons(
+                [
+                    new ScreenFooterButton
+                    {
+                        Text = "i break things", Action = () => { }
+                    }
+                ]
+            ));
+        }
+
         [Test]
         public void TestButtonsHiddenByExternalOverlayContentCannotBeTriggered()
         {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In master / latest release, a similar visual bug happens when pressing home at mod select overlay or TestShowOverlayHidesOtherOverlays / changing from freestyle mod select to regular:

Screen.Recording.2026-07-15.at.8.27.24.PM.mov
Screen.Recording.2026-07-15.at.8.28.36.PM.mov

Not sure what the FinishTransforms() added in 56d1255 fixes. Removing that or changing it to ClearTransforms() doesn't seem to regress things visually, unless there's an edge case. cc @frenzibyte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pre-exit dialog abruptly cuts the mod select transition and blocks some function keys on the next carousel load

2 participants